/* 图片居中显示 */
img {
  margin-left: auto;
  margin-right: auto;
  display: block;
  text-align: center;
  border: 2px solid #000;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

/* 处理表格，实现表格内容自动换行 */
table {
  table-layout: auto;
  width: 100%;
}

pre.mermaid {
  margin-left: auto;
  margin-right: auto;
  display: block;
  text-align: center;
}

td {
  word-break: keep-all;
  word-wrap: break-word;
  text-align: left;
}

/* 表格显示边框 */
table {
  /* 合并边框 */
  border-collapse: collapse;
}

table td,
table th {
  /* 设置边框厚度和颜色 */
  border: 2px solid black;
}

table tr:nth-child(even) {
  background: rgb(147, 146, 146)
}

table tr:nth-child(odd) {
  background: #FFF
}


/* 处理代码段 */
code {
  display: block;
  max-width: 100%;
  word-wrap: break-word;
  white-space: pre-wrap;
  background: black;
}

pre code::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: red;
  margin-left: 5px;
  display: block;
}

pre code::after {
  content: "";
  position: absolute;
  top: 0;
  left: 15px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: green;
  display: block;
}

/* 调整字体大小 */
body {
  font-size: 12px;
}

/* 引用部分格式设置 */
blockquote {
  --md-primary-color: #0F4C81;
  --blockquote-background: #f7f7f7;
  text-align: left;
  line-height: 1.75;
  font-size: 14px;
  border-left: 4px solid var(--md-primary-color);
  border-right: 2px solid var(--md-primary-color);
  padding: 1em 1em 1em 2em;
  border-radius: 6px;
  color: rgba(0, 0, 0, 0.8);
  background: var(--blockquote-background);
  margin: 2em 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

blockquote::before,
::after {
  box-sizing: border-box;
  border-width: 1px;
  border-style: solid;
}

blockquote p::before {
  content: "★ ";
  display: inline;
  color: rgb(14, 136, 235);
  font-size: 4em;
  line-height: 1em;
  font-weight: 700;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  display: inline-block;
  position: relative;
  background: #F3715D;
  color: white;
  text-align: center;
  padding: 0px 25px 0px 15px;
  height: 45px;
  line-height: 45px;
  border-radius: 0px 25px 25px 0px;
  letter-spacing: 2px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  page-break-after: avoid;
}


h1 {
  color: #f70404;
  font-weight: bold;
  background-color: #fcfcfc;
  border: 2px solid #f70404;
  border-left: 5px solid #f70404;
  box-shadow: 2px 6px 10px #f70404;
}

h2 {
  color: #9008ff;
  font-weight: bold;
  background-color: #fcfcfc;
  border: 2px solid #9008ff;
  border-left: 5px solid #9008ff;
  box-shadow: 2px 6px 10px #9008ff;
}

h3 {
  color: #ee5e0a;
  font-weight: bold;
  background-color: #fcfcfc;
  border: 2px solid #ee5e0a;
  border-left: 5px solid #ee5e0a;
  box-shadow: 2px 6px 10px #ee5e0a;
}

h4 {
  color: #0056ff;
  font-weight: bold;
  background-color: #fcfcfc;
  border: 2px solid #0056ff;
  border-left: 5px solid #0056ff;
  box-shadow: 2px 6px 10px #0056ff;
}

h5 {
  color: #0bf072;
  font-weight: bold;
  background-color: #fcfcfc;
  border: 2px solid #0bf072;
  border-left: 5px solid #0bf072;
  box-shadow: 2px 6px 10px #0bf072;
}

h6 {
  color: #00b3fa;
  font-weight: bold;
  background-color: #fcfcfc;
  border: 2px solid #00b3fa;
  border-left: 5px solid #00b3fa;
  box-shadow: 2px 6px 10px #00b3fa;
}

.mermaid {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/**
 * Print styles
 */
@media print {
  table {
    page-break-after: auto
  }

  tr {
    page-break-inside: avoid;
    page-break-after: auto
  }

  td {
    page-break-inside: avoid;
    page-break-after: auto
  }

  thead {
    display: table-header-group
  }

  tfoot {
    display: table-footer-group
  }
}